﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SF.Common;
using System.Collections;
using System.Data;
using System.Configuration;


namespace SF.Web.UI.mallCs
{
    public class newAddress
    {
        public string loaddingUsing(Model.sf_user_info userInfo, string templateType)
        {
            string usingMsg = "";
            if (userInfo != null)
            {
                if (templateType == "weishangred" || templateType == "weishanggreen" || templateType == "syj")
                {
                    usingMsg = "<link href='css/newaddress.css' rel='stylesheet' />";
                }
            }
            return usingMsg;
        }
        public string loaddingJs(Model.sf_user_info userInfo, string templateType)
        {
            string jsMsg = "";
            if (userInfo != null)
            {
                if (templateType == "weishangred" || templateType == "weishanggreen" || templateType == "syj")
                {
                    jsMsg = "function addAddress() {var names = $('#name').val().trim();var phones = $('#mobile').val().trim();var texts = $('#detail').val().trim();if (names == '' || phones == '' || texts == '') {alert('请完善信息！');return;}$.get('/tools/user_ajax.ashx', { action: 'add_address', name: names,phone:phones,text:texts }, function (res) {if (res = '0') {location.href = 'address.aspx?orderId=' + $('#orderNum').text();} else {alert('请稍后再试！');}});}";
                }
            }
            return jsMsg;
        }
        public string loaddingHtml(Model.sf_user_info userInfo, string parm1, string templateType)
        {
            string htmlMsg = "";
            if (userInfo != null)
            {
                if (templateType == "weishangred" || templateType == "weishanggreen" || templateType == "syj")
                {
                    htmlMsg = "<body><form id='form1' runat='server'><header id='header' class='u-header clearfix'><div class='u-hd-left f-left'><a href='javascript:history.back();' class='J_backToPrev'><span class='u-icon-px i-hd-back'></span></a></div><span id='orderNum' style='display:none;'>" + parm1 + "</span><div class='u-hd-tit'><span>新增配送地址</span></div><div class='u-hd-right f-right'><a href='index.aspx'><span class='u-icon-px i-hd-home'></span></a></div></header><div class='connerdiv'><dl class='connerbox'><dd><span class='form_hd'>姓名：</span><span class='form_td'><input id='name' value='' maxlength='50' class='text_input' type='text'/></span></dd><dd><span class='form_hd'>手机：</span><span class='form_td'><input id='mobile' value='' maxlength='11' class='text_input' type='text'/></span></dd></dl><dl class='connerbox'><dd><span>详情地址：</span><textarea id='detail' name='address' rows='5' class='textarea_input textarea_address'></textarea></dd></dl><div class='ui-btn-area'><a id='btnSubmit' href='javascript:;' class='btn_red' onclick='addAddress()' >完成</a></div></div><div class='space10'></div><a href='#top' class='u-backtop'><span class='u-icon-px i-backtop'></span></a></form></body>";
                }
            }
            return htmlMsg;
        }
    }
}
